<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
   function balance(){
    let bankCardBalance = Number(prompt('请输入银行卡余额'))
    let roomAndBoard = Number(prompt('请输入银行卡余额'))
    let alimony = Number(prompt('输入当月生活消费金额'))
    bankCardBalance -= (roomAndBoard + alimony )
    
    return bankCardBalance
   }
   balance()
  </script>

<!-- // function consumption() {
  //   let balance = []
  //   balance.push(prompt('输入银行卡余额') , prompt('输入当月食宿消费金额') , prompt('输入当月食宿消费金额'))
    
  // let sum = balance[0]
  // for(let i = 1; i < balance.length; i++){
  //   sum -= balance[i]
  // }
  // document.write(`您的余额为${sum}`);
  //   return sum
  // }
  // consumption() -->
</body>

</html>

